#pragma once
#include "Sock.h"
#include "Theadlib/thread.h"
#include "snetwork/NluConnection.h"
#include "snetwork/NluHttpRequest.h"

class  SNETWORK_API Sock::CNluHttpResponse 
{
public:
    static CNluHttpResponse *instance();
    int execute(nl_http_request_t *r);
    ssize_t unixSend(nl_connection_t *c, char *buf, size_t size);
    ssize_t fileSend(nl_connection_t *c, http_buf_t *b, size_t size);
    ssize_t HttpWriteResponseHeader(nl_http_request_t *r);
    
protected:

	
private: 
    static CNluHttpResponse* m_instance;
    CNluHttpResponse();    
    class CGarbo {public: ~CGarbo(){if (CNluHttpResponse::m_instance) delete CNluHttpResponse::m_instance;}};
    static CGarbo Garbo;	
};
